package com.gimi.cloud.bbp.dao.dao.sys;

import com.gimi.cloud.bbp.dao.common.SqlProvider;
import com.gimi.cloud.bbp.dao.myMapper.MyMapper;
import com.gimi.cloud.bbp.entity.sys.SysMasterRoleEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;

/**
* 管理员管理相关数据库访问方法
* @author wbj
* @Description
* @create 2017-12-01
* @version 1.0
**/
public interface SysMasterRoleDao extends MyMapper<SysMasterRoleEntity>{

    /**
     * 根据用户id删除对应的绑定角色信息
     * @param maId 用户id
     * @return 删除结果
     */
    @Delete("DELETE FROM sys_master_role WHERE ma_id = #{maId};")
    Integer deleteByMaId(@Param(value = "maId") Integer maId);

    @InsertProvider(type = SqlProvider.class,method = "sql")
    Integer saveBatch(String sql);

}
